package com.lianniu.web.tea.map.controller;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lianniu.web.base.BaseResult;
import com.lianniu.web.tea.map.service.ITeaUserPlaceService;

@Controller
@RequestMapping("/rest/teaUserPlace")
public class TeaUserPlaceRestController {

	public static final Logger logger = Logger.getLogger(TeaUserPlaceRestController.class);

	@Resource
	private ITeaUserPlaceService teaUserPlaceService;

	@RequestMapping(value = "/getUserPlace", method = { RequestMethod.POST, RequestMethod.GET })
	public @ResponseBody BaseResult getUserPlace(@RequestParam(value = "userId", required = false) String userId,
			@RequestParam(value = "lon", required = false) Float lon,
			@RequestParam(value = "lat", required = false) Float lat) {
		logger.info("TeaUserPlaceRestController getUserPlace begin");
		BaseResult result = teaUserPlaceService.getUserPlace(userId, lon, lat);
		logger.info("TeaUserPlaceRestController getUserPlace end");
		return result;
	}

}
